package ssm.service;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import ssm.dao.ManagerMapper;
import ssm.entity.Manager;


@Service
public class ManagerService {
	
	@Autowired
	private ManagerMapper managerMapper;
	
	/**
	 * 验证用户名
	 * @param record
	 * @return
	 */
	public Manager checkUsername(Manager record) {
		return managerMapper.checkUsername(record);
	}
	
	/**
	 * 验证密码
	 * @param manager
	 * @return
	 */
	public boolean isManager(Manager manager){
		
		if(managerMapper.getManager(manager)!=null) {
			return true;
		}else {
			return false;
		}
	}
	
	/**
	 * 验证成功后获取管理员信息
	 * @param manager
	 * @return
	 */
	public Manager getManager(Manager manager){
		return managerMapper.getManager(manager);
	}
	
	/**
	 * 修改管理员信息
	 * @param record
	 * @return
	 */
	public int updateManager(Manager record) {
		return managerMapper.updateManager(record);
	}
}
